{extend name="admin@publics/base"/}
{block name="title"}修改密码{/block}
{block name="body"}

<script>
Ext.onReady(function () {
	var _AdminIndexRpassword_Form = Ext.create('Ext.form.Panel', {
		id:'_AdminIndexRpassword_Form',
		region: 'center',
		border: false,
		items: [{
			autoScroll: true,
			tabPosition: 'left',
			tabRotation: 0,
			buttonAlign: "right",
			bodyStyle: 'padding:10px;',
			border: false,
			items: [
				{xtype: 'fieldset',title: '密码',autoHeight: true,layout: 'column',defaults: {labelAlign: 'left',labelWidth: 60,columnWidth: 0.5,style: {padding: '5px'}},items: [
					{fieldLabel: '新密码', name: 'password',height:30,xtype: "textfield",inputType: 'password',},
					{fieldLabel: '重复密码', name: 'password2',height:30,xtype: "textfield",inputType: 'password',},
				]}
			]
		}],
		tbar: new Ext.Toolbar({
			height: 45,
			bodyStyle: 'text-align:left',
			items: [
				{xtype: 'label',text: '修改密码',style: 'font-size:16px; padding-right:10px;margin-right: 10px;border-right: dotted 1px #ccc;'},
				/*{if condition="_CheckAuth('admin/Index/ruserinfo')"}*/
				{xtype: 'button',text: '修改资料',iconCls: 'tf tf-add',handler: function(){window.location.href = _PATH['site']+'/admin/index/ruserinfo';}},
				/*{/if}*/
			]
		}),
		bbar: new Ext.Toolbar({height: 45,style: 'background: #5fa2dd;',items: [
			'->',
			{text: '提交',xtype: 'button',handler: _OnEditSubmit},
		]})
	});
	var _AdminIndex = Ext.create('Ext.container.Viewport', {
        layout: 'border',
		items: [
			_AdminIndexRpassword_Form
        ]
	});
	//新增提交
	function _OnEditSubmit(){
		var _Form = Ext.getCmp('_AdminIndexRpassword_Form');
        Ext.Ajax.request({
            url: _PATH['site'] + '/admin/index/rpassword',
            method: 'post',
            params: _Form.getValues(),
            success: function (response, options) {
                var _Res = Ext.util.JSON.decode(response.responseText);
                if (parseInt(_Res.code) == 200) {
                    Ext.Msg.alert('成功', _Res.msg);
                } else {
                    Ext.Msg.alert('错误', _Res.msg);
                }
            },
            failure: function () {
            }
        });
	}
})
</script>
{/block}
{/literal}